home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
3908.ZIP
/
DPN_TEST.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-19
|
1KB
|
40 lines
#include "C:\DPN\DPN.HPP"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <conio.h>
int main(void)
{
Task *Job[10];
int i;
int AllDone;
char FileName[255];
DPN_Initialise();
for (i=0;i<10;i++) {
Job[i]=new Task(strcat(strcpy(FileName,getenv("NETDRIVE")),"\\NOTHING.EXE"),"");
printf("Spooled task #%d\n",i);
}
printf("Press ENTER to commence killing the tasks ");
getche();
printf("\n\n");
for (i=0;i<10;i++) {
if (Job[i]->Kill())
printf("Cannot kill task #%d : %s\n",i,DPN_ErrorMsg(Job[i]->ErrorCode(),FileName));
else
printf("Task #%d successfully killed\n",i);
}
do {
DPN_Pause();
AllDone=1;
for (i=0;i<10;i++)
if (!Job[i]->Finished())
AllDone=0;
printf("%d tasks still pending\n",DPN_Pending());
} while (!AllDone);
for (i=0;i<10;i++)
printf("Task #%d : ExitCode=%d, %s\n",i,Job[i]->ExitCode(),DPN_ErrorMsg(Job[i]->ErrorCode(),FileName));
}